<?php

error_reporting(E_ERROR | E_WARNING | E_PARSE);
//error_reporting(E_ALL);

set_magic_quotes_runtime(0);
$mtime = explode(' ', microtime());
$starttime = $mtime[1] + $mtime[0];

define('IN_JANSEN', TRUE);
define('JANSEN_ROOT', substr(dirname(__FILE__), 0, -7));

if(PHP_VERSION < '4.1.0') {
    $_GET = &$HTTP_GET_VARS;
    $_POST = &$HTTP_POST_VARS;
    $_COOKIE = &$HTTP_COOKIE_VARS;
    $_SERVER = &$HTTP_SERVER_VARS;
    //$_ENV = &$HTTP_ENV_VARS;
    $_FILES = &$HTTP_POST_FILES;
}
unset($_ENV,$HTTP_ENV_VARS,$_REQUEST,$HTTP_POST_VARS,$HTTP_GET_VARS,$HTTP_POST_FILES,$HTTP_COOKIE_VARS,$HTTP_SERVER_VARS);


require_once JANSEN_ROOT.'./include/global.function.php';
require_once JANSEN_ROOT.'./debuger.php';

// תȫֱ
$magic_quotes_gpc = get_magic_quotes_gpc();
@daddslashes($_COOKIE);
@daddslashes($_POST);
@daddslashes($_GET);
if(!$magic_quotes_gpc) {
	$_FILES = daddslashes($_FILES);
}

/*
$magic_quotes_gpc = get_magic_quotes_gpc();
$register_globals = @ini_get('register_globals');
if(!$register_globals) {
    daddslashes($_POST);
    daddslashes($_GET);
    //@extract(daddslashes($_POST));
    //@extract(daddslashes($_GET));
} else {
    if (isset($_REQUEST)) {
        foreach ($_REQUEST as $var_name => $void) {
            unset(${$var_name});
        }
    }
}

if(!$magic_quotes_gpc) {
    $_FILES = daddslashes($_FILES);
}
*/

require_once JANSEN_ROOT.'./config.inc.php';
require_once JANSEN_ROOT.'./include/db_'.$database.'.class.php';


$timestamp = time();
$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];

$_DCOOKIE = $_DSESSION = $_DCACHE = array();

if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'), 'unknown')) {
    $onlineip = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown')) {
    $onlineip = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR') && strcasecmp(getenv('REMOTE_ADDR'), 'unknown')) {
    $onlineip = getenv('REMOTE_ADDR');
} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], 'unknown')) {
    $onlineip = $_SERVER['REMOTE_ADDR'];
}
$onlineip = preg_replace("/^([\d\.]+).*/", "\\1", $onlineip);

// user type and status
$USER_TYPE_ARY = array('1'=>'Wholesale Customer', '2'=>'Container Customer');   // 1=>w 2=>c
$USER_STATUS_ARY = array('1'=>'Temporary', '2'=>'active', '3'=>'susp');
//$USER_STATUS_ARY = array('2'=>'active', '3'=>'susp');
$INVENTORY_TYPE_ARY = array('1'=>'Hong Kong Warehouse', '2'=>'Overseas Warehouse');

$STATE_ARY = array(
'2' => 'Alaska',
'3' => 'Arizona',
'4' => 'Arkansas',
'5' => 'California',
'6' => 'Colorado',
'7' => 'Connecticut',
'8' => 'Delaware',
'9' => 'District of Columbia',
'10' => 'Florida',
'11' => 'Georgia',
'12' => 'Hawaii',
'13' => 'Idaho',
'14' => 'Illinois',
'15' => 'Indiana',
'16' => 'Iowa',
'17' => 'Kansas',
'18' => 'Kentucky',
'19' => 'Louisiana',
'20' => 'Maine',
'21' => 'Maryland',
'22' => 'Massachusetts',
'23' => 'Michigan',
'24' => 'Minnesota',
'25' => 'Mississippi',
'26' => 'Missouri',
'27' => 'Montana',
'28' => 'Nebraska',
'29' => 'Nevada',
'30' => 'New Hampshire',
'31' => 'New Jersey',
'32' => 'New Mexico',
'33' => 'New York',
'34' => 'North Carolina',
'35' => 'North Dakota',
'36' => 'Ohio',
'37' => 'Oklahoma',
'38' => 'Oregon',
'39' => 'Pennsylvania',
'40' => 'Rhode Island',
'41' => 'South Carolina',
'42' => 'South Dakota',
'43' => 'Tennessee',
'44' => 'Texas',
'45' => 'Utah',
'46' => 'Vermont',
'47' => 'Virginia',
'48' => 'Washington',
'49' => 'West Virginia',
'50' => 'Wisconsin',
'51' => 'Wyoming',
'53' => 'Alberta',
'54' => 'British Columbia',
'55' => 'Manitoba',
'56' => 'New Brunswick',
'57' => 'Newfoundland',
'58' => 'Northwest Territories',
'59' => 'Nova Scotia',
'60' => 'Nunavut',
'61' => 'Ontario',
'62' => 'Prince Edward Island',
'63' => 'Quebec',
'64' => 'Saskatchewan',
'65' => 'Yukon',
'66' => 'Unlisted',
);

$COUNTRY_ARY = array(
'1' => 'Afghanistan',
'2' => 'Albania',
'3' => 'Algeria',
'4' => 'Andorra',
'5' => 'Angola',
'6' => 'Anguilla',
'7' => 'Antigua/Barbuda',
'8' => 'Argentina',
'9' => 'Armenia',
'10' => 'Aruba',
'11' => 'Australia',
'12' => 'Austria',
'13' => 'Azerbaijan',
'14' => 'Azores',
'15' => 'Bahamas',
'16' => 'Bahrain',
'17' => 'Bangladesh',
'18' => 'Barbados',
'19' => 'Belarus',
'20' => 'Belgium',
'21' => 'Belize',
'22' => 'Benin',
'23' => 'Bermuda',
'24' => 'Bhutan',
'25' => 'Bolivia',
'26' => 'Bosnia Herzegovina',
'27' => 'Botswana',
'28' => 'Brazil',
'29' => 'British Virgin Islands',
'30' => 'Brunei Darussalam',
'31' => 'Bulgaria',
'32' => 'Burkina Faso',
'33' => 'Burma',
'34' => 'Burundi',
'35' => 'Cameroon',
'36' => 'Canada',
'37' => 'Cape Verde',
'38' => 'Cayman Islands',
'39' => 'Central African Republic',
'40' => 'Chad',
'41' => 'Chile',
'42' => 'China',
'43' => 'Colombia',
'44' => 'Comoros',
'45' => 'Congo',
'46' => 'Corsica',
'47' => 'Costa Rica',
'48' => 'Cote d\'Ivoire (Ivory Coast)',
'49' => 'Croatia',
'50' => 'Cyprus',
'51' => 'Czech Republic',
'52' => 'Denmark',
'53' => 'Djibouti',
'54' => 'Dominica',
'55' => 'Dominican Republic',
'56' => 'Ecuador',
'57' => 'Egypt',
'58' => 'El Salvador',
'59' => 'Equatorial Guinea',
'60' => 'Eritrea',
'61' => 'Estonia',
'62' => 'Ethiopia',
'63' => 'Falkland Islands',
'64' => 'Faroe Islands',
'65' => 'Fiji',
'66' => 'Finland',
'67' => 'France/Monaco',
'68' => 'French Guiana',
'69' => 'French Polynesia',
'70' => 'Gabon',
'71' => 'Gambia',
'72' => 'Georgia, Republic of',
'73' => 'Germany',
'74' => 'Ghana',
'75' => 'Gibraltar',
'76' => 'Great Britain/N. Ireland',
'77' => 'Greece',
'78' => 'Greenland',
'79' => 'Grenada',
'80' => 'Guadeloupe',
'81' => 'Guatemala',
'82' => 'Guinea',
'83' => 'Guinea Bissau',
'84' => 'Guyana',
'85' => 'Haiti',
'86' => 'Honduras',
'87' => 'Hong Kong',
'88' => 'Hungary',
'89' => 'Iceland',
'90' => 'India',
'91' => 'Indonesia',
'92' => 'Iran',
'93' => 'Iraq',
'94' => 'Ireland',
'95' => 'Israel',
'96' => 'Italy',
'97' => 'Jamaica',
'98' => 'Japan',
'99' => 'Jordan',
'100' => 'Kazakhstan',
'101' => 'Kenya',
'102' => 'Kiribati',
'103' => 'Korea (North)',
'104' => 'Korea (South)',
'105' => 'Kuwait',
'106' => 'Kyrgyzstan',
'107' => 'Laos',
'108' => 'Latvia',
'109' => 'Lebanon',
'110' => 'Lesotho',
'111' => 'Liberia',
'112' => 'Libya',
'113' => 'Liechtenstein',
'114' => 'Lithuania',
'115' => 'Luxembourg',
'116' => 'Macao',
'117' => 'Macedonia',
'118' => 'Madagascar',
'119' => 'Madeira Islands',
'120' => 'Malawi',
'121' => 'Malaysia',
'122' => 'Maldives',
'123' => 'Mali',
'124' => 'Malta',
'125' => 'Martinique',
'126' => 'Mauritania',
'127' => 'Mauritius',
'128' => 'Mexico',
'129' => 'Moldova',
'130' => 'Mongolia',
'131' => 'Montserrat',
'132' => 'Morocco',
'133' => 'Mozambique',
'134' => 'Namibia',
'135' => 'Nauru',
'136' => 'Nepal',
'137' => 'Netherlands',
'138' => 'Netherlands Antilles',
'139' => 'New Caledonia',
'140' => 'New Zealand',
'141' => 'Nicaragua',
'142' => 'Niger',
'143' => 'Nigeria',
'144' => 'Norway',
'145' => 'Oman',
'146' => 'Pakistan',
'147' => 'Panama',
'148' => 'Papua New Guinea',
'149' => 'Paraguay',
'150' => 'Peru',
'151' => 'Philippines',
'152' => 'Pitcairn Island',
'153' => 'Poland',
'154' => 'Portugal',
'155' => 'Qatar',
'156' => 'Republic of',
'157' => 'Reunion',
'158' => 'Romania',
'159' => 'Russia',
'160' => 'Rwanda',
'161' => 'Saint Helena',
'162' => 'Saint Lucia',
'163' => 'Saint Pierre/Miquelon',
'164' => 'Saint Vincent/Grenadines',
'165' => 'San Marino',
'166' => 'Sao Tome and Principe',
'167' => 'Saudi Arabia',
'168' => 'Senegal',
'169' => 'Serbia Monteneg/Yugoslavia',
'170' => 'Seychelles',
'171' => 'Sierra Leone',
'172' => 'Singapore',
'173' => 'Slovak Republic',
'174' => 'Slovenia',
'175' => 'Solomon Islands',
'176' => 'Somalia',
'177' => 'South Africa',
'178' => 'Spain',
'179' => 'Sri Lanka',
'180' => 'St. Kitts and Nevis',
'181' => 'Sudan',
'182' => 'Suriname',
'183' => 'Swaziland',
'184' => 'Sweden',
'185' => 'Switzerland',
'186' => 'Syria',
'187' => 'Taiwan',
'188' => 'Tajikistan',
'189' => 'Tanzania',
'190' => 'Thailand',
'191' => 'Togo',
'192' => 'Tonga',
'193' => 'Trinidad/Tobago',
'194' => 'Tristan da Cunha',
'195' => 'Tunisia',
'196' => 'Turkey',
'197' => 'Turkmenistan',
'198' => 'Turks/Caicos Islands',
'199' => 'Tuvalu',
'200' => 'Uganda',
'201' => 'Ukraine',
'202' => 'United Arab Emirates',
'216' => 'UK',
'203' => 'USA',
'204' => 'Uruguay',
'205' => 'Uzbekistan',
'206' => 'Vanuatu',
'207' => 'Vatican City',
'208' => 'Venezuela',
'209' => 'Vietnam',
'210' => 'Wallis/Futuna Islands',
'211' => 'Western Samoa',
'212' => 'Yemen',
'213' => 'Zaire',
'214' => 'Zambia',
'215' => 'Zimbabwe',
);

$AREA_ARY = array(
'1' => array('name'=>'North America',  'id'=>'1'),
'2' => array('name'=>'Latin America',  'id'=>'2'),
'3' => array('name'=>'Europe',  'id'=>'3'),
'4' => array('name'=>'Middle East',  'id'=>'4'),
'5' => array('name'=>'Asia & Pacific',  'id'=>'5'),
'6' => array('name'=>'Africa',  'id'=>'6'),
);


$browse_tracking_ary = array(1=>'Login', 2=>'About us', 3=>'Products', 4=>'Inventory', 5=>'Tradeshow', 6=>'Search', 7=>'Gallery',8=>'Logout',9=>'Link',10=>'Distribution',11=>'Specials',12=>'Product New Items',13=>'Photo Gallery',14=>'How to Order',15=>'Inventory',16=>'Tradeshows',17=>'New Items',18=>'Product' );


$LEFT_MENU_IN_ARY = array(
'1' => array('name'=>'Home', 'url'=>'index.php', 'pic'=>'jf_nav_main_home'),

'2' => array('name'=>'About Us', 'url'=>'aboutus.php', 'pic'=>'jf_nav_main_about_us'),
'3' => array('name'=>'Photo Gallery', 'url'=>'photo.php', 'pic'=>'jf_nav_main_photo_gallery'),
'4' => array('name'=>'How to Order', 'url'=>'howtoorder.php', 'pic'=>'jf_nav_main_how_to_order'),
'5' => array('name'=>'Products', 'url'=>'products.php', 'pic'=>'jf_nav_main_products'),
'6' => array('name'=>'Inventory', 'url'=>'inventory.php', 'pic'=>'jf_nav_main_inventory'),

'7' => array('name'=>'New Items', 'url'=>'new_items.php', 'pic'=>'jf_nav_main_newitems'),
'8' => array('name'=>'Specials', 'url'=>'specials.php', 'pic'=>'jf_nav_main_specials'),

//'9' => array('name'=>'News', 'url'=>'news.php', 'pic'=>'jf_nav_main_news'),
'10' => array('name'=>'Tradeshows', 'url'=>'tradeshows.php', 'pic'=>'jf_nav_main_tradeshows'),
'11' => array('name'=>'Distribution', 'url'=>'distribution.php', 'pic'=>'jf_nav_main_distribution'),
'12' => array('name'=>'Links', 'url'=>'links.php', 'pic'=>'jf_nav_main_links'),
'13' => array('name'=>'Contact Us', 'url'=>'mailto:info@jansenfurniture.nl', 'pic'=>'jf_nav_main_contact_us'),
'14' => array('name'=>'Logout', 'url'=>'login.php?action=logout', 'pic'=>'jf_nav_main_dealerlogout'),
);

$LEFT_MENU_OUT_ARY = array(
'1' => array('name'=>'Home', 'url'=>'index.php', 'pic'=>'jf_nav_main_home'),
'2' => array('name'=>'About Us', 'url'=>'aboutus.php', 'pic'=>'jf_nav_main_about_us'),
'3' => array('name'=>'Photo Gallery', 'url'=>'photo.php', 'pic'=>'jf_nav_main_photo_gallery'),
'4' => array('name'=>'How to Order', 'url'=>'howtoorder.php', 'pic'=>'jf_nav_main_how_to_order'),
'5' => array('name'=>'Products', 'url'=>'products.php', 'pic'=>'jf_nav_main_products'),
'10' => array('name'=>'Tradeshows', 'url'=>'tradeshows.php', 'pic'=>'jf_nav_main_tradeshows'),
//'6' => array('name'=>'Inventory', 'url'=>'inventory.php', 'pic'=>'jf_nav_main_inventory'),
//'7' => array('name'=>'News', 'url'=>'news.php', 'pic'=>'jf_nav_main_news'),
'11' => array('name'=>'Distribution', 'url'=>'distribution.php', 'pic'=>'jf_nav_main_distribution'),
'12' => array('name'=>'Links', 'url'=>'links.php', 'pic'=>'jf_nav_main_links'),
'13' => array('name'=>'Contact Us', 'url'=>'contactus.php', 'pic'=>'jf_nav_main_contact_us'),
'14' => array('name'=>'Dealer Login', 'url'=>'login.php', 'pic'=>'jf_nav_main_login'),
);

@list($jansen_uid,$jansen_type,$jansen_status, $login_time)=explode("\t",  base64_decode(GetCookie('jansenuser')));
if ($jansen_uid > 0 && $jansen_type > 0 && time() - $login_time <= 1800) {
    Cookie("jansenuser",base64_encode($jansen_uid."\t".$jansen_type."\t".$jansen_status."\t".$timestamp), $cookietime); 
} else {    
    Cookie('jansenuser','',0);
    $jansen_uid = 0;
    $jansen_type = 0;
}

$jansen_total_qty1 = $jansen_wishlist_qty1 = 0;
$total_item = $wishlist_item = 'Item';
$top_out = '';

$JANSEN_CONTAINER_TOTAL_CBM = $JANSEN_CONTAINER_TOTAL_CUFT = $JANSEN_CONTAINER_TOTAL_QTY2 = 0;
//$jansen_uid = $jansen_type = 1;
if ($jansen_uid > 0 && $jansen_type > 0) {

    $SNAME = session_name("JANSENSESSION_" . $jansen_uid);
    if (isset($_COOKIE[$SNAME]) || isset($_GET[$SNAME])) {
        $SID = isset($_COOKIE[$SNAME]) ? $_COOKIE[$SNAME] : $_GET[$SNAME];
        session_id($SID);
    } else {
        $SID = session_id();
    }
    session_start();

    require_once JANSEN_ROOT . 'include/cart.class.php';

    $cart = new cart();
    $JANSEN_CONTAINER_ARY = $cart->getData();
    $JANSEN_CONTAINER_TOTAL_QTY = $cart->getSortCount();
    $JANSEN_CONTAINER_TOTAL_COST = $cart->getTotalCost();
    //echo "<pre>";print_r($JANSEN_CONTAINER_ARY);

    foreach ($JANSEN_CONTAINER_ARY as $k=>$v) {
        $JANSEN_CONTAINER_TOTAL_CBM += $v['cbm']*$v['count'];
        $JANSEN_CONTAINER_TOTAL_CUFT += $v['cuft']*$v['count'];
        $JANSEN_CONTAINER_TOTAL_QTY2 += $v['count'];
    }
    $jansen_total_qty1 = $JANSEN_CONTAINER_TOTAL_QTY;
    $JANSEN_CONTAINER_TOTAL_COST1  = number_format($JANSEN_CONTAINER_TOTAL_COST, 2, '.', ',');
    $JANSEN_CONTAINER_TOTAL_CBM  = number_format(round($JANSEN_CONTAINER_TOTAL_CBM), 0, '.', ',');
    $JANSEN_CONTAINER_TOTAL_CUFT  = number_format(round($JANSEN_CONTAINER_TOTAL_CUFT), 0, '.', ',');

    if ($jansen_type == 1) {
        $MONEY_TYPE = " HKD";
    } else {
        $MONEY_TYPE = " USD";
    }
    $top_out = "&nbsp;&nbsp;" . $JANSEN_CONTAINER_TOTAL_CBM . " CBM&nbsp;&nbsp;" . $JANSEN_CONTAINER_TOTAL_CUFT . " CUFT&nbsp;&nbsp;" . $JANSEN_CONTAINER_TOTAL_COST1 . " $MONEY_TYPE";
    /*if ($JANSEN_CONTAINER_TOTAL_QTY == 0 || $JANSEN_CONTAINER_TOTAL_QTY == "") {
        $top_out = '';
    }*/
    $LEFT_MENU_ARY = $LEFT_MENU_IN_ARY;
    if (isset($_COOKIE['jansen_wishlist_qty'])) {
        //$jansen_total_qty1 = $_COOKIE['jansen_total_qty'];
        $jansen_wishlist_qty1 = isset($_COOKIE['jansen_wishlist_qty']) ? $_COOKIE['jansen_wishlist_qty'] : 0;
        $total_item = $jansen_total_qty1 > 1 ? 'Items' : 'Item';
        $wishlist_item = $jansen_wishlist_qty1 > 1 ? 'Items' : 'Item';
    }
    $user_status = <<<EOT
<td height="20"><img src="./images/cart_display/jf_cart_dispay_cart.gif" alt="Cart:" name="jf_cart_dispay_cart" width="73" height="20" id="jf_cart_dispay_cart"></td>
                <td align="left" valign="top" height="20" class="cartAreaValues"><div><img name="" src="./images/spacer.gif" width="1" height="5" alt=""></div>
                   
                  <span class="item_number">: $top_out</span> </td>
                <td width="10" height="20"><img src="./images/cart_display/jf_cart_dispay_divider.gif" alt="Image Divider" name="jf_cart_dispay_divider" width="10" height="20" id="jf_cart_dispay_divider"></td>
                <td height="20"><a href="cart_view.php" onMouseOver="MM_swapImage('jf_cart_dispay_view_cart','','./images/cart_display/jf_cart_dispay_view_cart-over.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="./images/cart_display/jf_cart_dispay_view_cart.gif" alt="View Cart" name="jf_cart_dispay_view_cart" width="100" height="20" border="0" id="jf_cart_dispay_view_cart"></a></td>
                <td width="10" height="20"><img src="./images/cart_display/jf_cart_dispay_divider.gif" alt="Image Divider" name="jf_cart_dispay_divider" width="10" height="20" id="jf_cart_dispay_divider"></td>
                <td width="51" height="20"><img src="./images/cart_display/jf_cart_dispay_wishlist.gif" alt="Wishlist:" name="jf_cart_dispay_wishlist" width="56" height="20" id="jf_cart_dispay_wishlist"></td>
                <td align="left" valign="top" height="20" class="cartAreaValues"><div><img name="" src="./images/spacer.gif" width="1" height="5" alt=""></div>
                   
                  <span class="item_number">: $jansen_wishlist_qty1 $wishlist_item</span> </td>
                <td width="10" height="20"><img src="./images/cart_display/jf_cart_dispay_divider.gif" alt="Image Divider" name="jf_cart_dispay_divider" width="10" height="20" id="jf_cart_dispay_divider"></td>
                <td width="58" height="20"><a href="wishlist_view.php" onMouseOver="MM_swapImage('jf_cart_dispay_view_list','','./images/cart_display/jf_cart_dispay_view_list-over.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="./images/cart_display/jf_cart_dispay_view_list.gif" alt="View List" name="jf_cart_dispay_view_list" width="63" height="20" border="0" id="jf_cart_dispay_view_list"></a></td>
                <td width="10" height="20"><img src="./images/cart_display/jf_cart_dispay_divider.gif" alt="Image Divider" name="jf_cart_dispay_divider" width="10" height="20" id="jf_cart_dispay_divider"></td>
                <td width="68" height="20"><a href="login.php?action=logout" onMouseOver="MM_swapImage('jf_cart_dispay_dealer_logout','','./images/cart_display/jf_cart_dispay_dealer_logout-over.gif',1)" onMouseOut="MM_swapImgRestore()" onclick="return confirm('Are you sure to logout ?')"><img src="./images/cart_display/jf_cart_dispay_dealer_logout.gif" alt="Dealer Logout" name="jf_cart_dispay_dealer_logout" width="88" height="20" border="0" id="jf_cart_dispay_dealer_logout"></a></td>
EOT;
    $page_search = <<<EOT
<table border="0" cellspacing="0" cellpadding="0">
              <form action="search_result.php" method="get" onSubmit="return CheckKeywordSearchForm(this);">
                <tr>
                  <td width="44" height="20"><img src="./images/cart_display/jf_cart_dispay_search.gif" alt="Search:" name="jf_cart_dispay_search" width="41" height="20" id="jf_cart_dispay_search"></td>
                  <td width="10" height="20"><img src="./images/spacer.gif" width="10" height="20"></td>
                  <td align="left" valign="middle" height="20"><input name="searchtext" type="text" class="cartAreaKeywordSearch" size="20"></td>
                  <td width="10" height="20"><img src="./images/spacer.gif" width="10" height="20"></td>
                  <td width="20" height="20"><input type="image" onMouseOver="MM_swapImage('jf_cart_dispay_go','','./images/cart_display/jf_cart_dispay_go-over.gif',1)" onMouseOut="MM_swapImgRestore()" src="./images/cart_display/jf_cart_dispay_go.gif" alt="Go" name="jf_cart_dispay_go" width="20" height="20" border="0" id="jf_cart_dispay_go"></td>
                </tr>
              </form>
            </table>
EOT;
} else {
    $LEFT_MENU_ARY = $LEFT_MENU_OUT_ARY;
    $user_status = <<<EOT
<td height="20" colspan="11"><a href="login.php" onMouseOver="MM_swapImage('jf_cart_dispay_dealer_login','','./images/cart_display/jf_cart_dispay_dealer_login-over.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="./images/cart_display/jf_cart_dispay_dealer_login.gif" alt="Dealer Login" name="jf_cart_dispay_dealer_login" width="79" height="20" border="0" id="jf_cart_dispay_dealer_login"></a></td>
EOT;
    $page_search = <<<EOT
<img src="./images/spacer.gif" width="10" height="20" align="left">
EOT;
}

$db = new DB($dbhost, $dbuser, $dbpw, $dbname, $pconnect);
unset($dbhost, $dbuser, $dbpw, $dbname, $pconnect);

$HAS_NEW_ITEM = true;
//if ($jansen_uid > 0 && $jansen_type > 0) {
$sql = "SELECT `id` FROM `product` WHERE `new_flag`='1'";

$has_new = $db->get_one($sql);
if (empty($has_new)) {
    unset($LEFT_MENU_ARY['7']);
    $HAS_NEW_ITEM = false;
}
unset($sql);
unset($has_new);

//}

// ̨ҳļ
if (eregi("/admin/", $_SERVER['REQUEST_URI']) || eregi("/admin/", $_SERVER['SCRIPT_NAME'])) {
    require_once JANSEN_ROOT.'./include/common.admin.inc.php';
}

?>